/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lcfgly.Form.Validation;

import com.lcfgly.Database.ShopOnepage;
import com.lcfgly.util.CharFilter;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;


/**
 *
 * @author lcfgly
 */
public class OnepageValidation implements Validator{

    @Override
    public boolean supports(Class<?> clazz) {
        return ShopOnepage.class.equals(clazz);
    }

    @Override
    public void validate(Object target, Errors errors) {
        ShopOnepage data=(ShopOnepage)target;
        data.setBody(CharFilter.getNoScriptString(data.getBody()));
    }
    
    
}
